<?php
function add(...$args)
{
    $num = count($args);
    echo "参数个数=$num";
    echo "<br>";
    $total = 0;
    foreach ($args as $arg)
    {
        $total += $arg;
    }
    //返回总数
    return $total;
}
echo add(1,2,3,4,5);
